#ifndef PRIMITIVE_METHOD_H
#define PRIMITIVE_METHOD_H
#include "Method.h"
#include "Object.h"
#include "Image.h"
#include "util.h"
#include "Class.h"
class PrimitiveMethod:public Method{
   public:
      PrimitiveMethod(Image* img,string selector,Class* cls,int argv,Object* (*primitive)(Image*,Object*,int argc,Object** argv));
      virtual Object* execute(Image* i,Object* receiver,int argc,Object** argv);
   private:
      Object* (*primitive) (Image*,Object*,int argc,Object** argv);
};
//definition of primitives below
#define PRIMITIVE_MATHOP_DECL(name)\
   Object* name(Image* image,Object* receiver,int argc,Object** argv);
PRIMITIVE_MATHOP_DECL(primitive_mathop_add);
PRIMITIVE_MATHOP_DECL(primitive_mathop_substract);
PRIMITIVE_MATHOP_DECL(primitive_mathop_multiply);
PRIMITIVE_MATHOP_DECL(primitive_mathop_divide);
PRIMITIVE_MATHOP_DECL(primitive_mathop_mod);
#define PRIMITIVE_TEST_DECL(name)\
   Object* name(Image* image,Object* receiver,int argc,Object** argv);
PRIMITIVE_TEST_DECL(primitive_test_equal);
PRIMITIVE_TEST_DECL(primitive_test_notEqual);
PRIMITIVE_TEST_DECL(primitive_test_greater);
PRIMITIVE_TEST_DECL(primitive_test_greater_or_equal);
PRIMITIVE_TEST_DECL(primitive_test_lesser);
PRIMITIVE_TEST_DECL(primitive_test_lesser_or_equal);
Object* primitive_is_null(Image* image,Object* self,int argc,Object** argv);
Object* primitive_if(Image* image,Object* self,int argc,Object** argv);
Object* primitive_do_nothing(Image* image,Object* self,int argc,Object** argv);

Object* primitive_string_at(Image* image,Object* self,int argc,Object** argv);
Object* primitive_string_length(Image* image,Object* self,int argc,Object** argv);
Object* primitive_con_string(Image* image,Object* self,int argc,Object** argv);
Object* primitive_con_newline(Image* image,Object* self,int argc,Object** argv);
Object* primitive_closure_execute(Image* image,Object* self,int argc,Object** argv);

Object* primitive_array_new(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_at_set(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_at(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_do(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_size(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_to_string_as_byte_array(Image* image,Object* self,int argc,Object** argv);
Object* primitive_array_resize(Image* image,Object* self,int argc,Object** argv);

Object* primitive_range_do(Image* image,Object* self,int argc,Object** argv);
        
#endif
